#ifndef _MODULE_DR16_H_
#define _MODULE_DR16_H_
#ifdef __cplusplus
extern "C" {
#endif

#include "includes.h"
	
typedef __packed struct
{
	float pitch;
	float yaw;

}Piont;	 
#define UnfollowModeYawScale 7 
#define KSCALE 1.2f	

#define IsKeyPressed(KEY)    (((KEY) & ptrmsg->key)?1:0)

#define W                    ((uint16_t)0x01<<0)
#define S                    ((uint16_t)0x01<<1)
#define A                    ((uint16_t)0x01<<2)
#define D                    ((uint16_t)0x01<<3)
#define SHIFT                ((uint16_t)0x01<<4)
#define CTRL                 ((uint16_t)0x01<<5)
#define Q                    ((uint16_t)0x01<<6)
#define E                    ((uint16_t)0x01<<7)
#define R                    ((uint16_t)0x01<<8)
#define F                    ((uint16_t)0x01<<9)
#define G                    ((uint16_t)0x01<<10)
#define Z                    ((uint16_t)0x01<<11)
#define X                    ((uint16_t)0x01<<12)
#define C                    ((uint16_t)0x01<<13)
#define V                    ((uint16_t)0x01<<14)
#define B                    ((uint16_t)0x01<<15)

/*********************************************************/
#define Key_W					((uint16_t)0x01<<0)
#define Key_S					((uint16_t)0x01<<1)
#define Key_A					((uint16_t)0x01<<2)
#define Key_D					((uint16_t)0x01<<3)
#define Key_SHIFT          ((uint16_t)0x01<<4)
#define Key_CTRL           ((uint16_t)0x01<<5)
#define Key_Q					((uint16_t)0x01<<6)
#define Key_E					((uint16_t)0x01<<7)
#define Key_R					((uint16_t)0x01<<8)
#define Key_F					((uint16_t)0x01<<9)
#define Key_G					((uint16_t)0x01<<10)
#define Key_Z					((uint16_t)0x01<<11)
#define Key_X					((uint16_t)0x01<<12)
#define Key_C					((uint16_t)0x01<<13)
#define Key_V					((uint16_t)0x01<<14)
#define Key_B					((uint16_t)0x01<<15)
/*********************************************************/

typedef struct KM_KEY_STRUCT
{
	char KMcounter;
	char KMFlag;
}KM_KEY;

void DR16_Pack_Handle(RC_Value *ptrmsg);


short Get_AxicX(void);
short Get_AxicY(void);
short Get_AxicZ(void);

short Get_AxicK(void);

void DR16_KM(RC_Value *ptrmsg,uint16_t KEY_PRESSED_OFFSET,KM_KEY * _pKEY);

#ifdef __cplusplus
}
#endif
#endif

